package com.brower.project.net

import com.brower.project.utils.CookiePreferences
import okhttp3.Interceptor
import okhttp3.Response

class ReadCookiesInterceptor : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        val builder = chain.request().newBuilder()
        CookiePreferences.getCookie()?.forEach {
            builder.addHeader("Cookie", it)
        }
        return chain.proceed(builder.build())
    }
}